<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
           
            <script>

                    function myfun(n){
                        return function(x){
                            return Math.pow(x,n)
                        }
                    }
                var pow1=myfun(3) //3次方
                console.log(pow1(2)); //2*2*2=8    

            </script>
</body>
</html>